package com.hrms.doctor.service.impl;

import com.hrms.doctor.domain.Schedule;
import com.hrms.doctor.domain.vo.ScheduleBriefVo;
import com.hrms.doctor.domain.vo.ScheduleVo;
import com.hrms.doctor.mapper.ScheduleMapper;
import com.hrms.doctor.service.ScheduleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;
import java.util.List;

@Service
public class ScheduleServiceImpl implements ScheduleService {
    @Autowired
    ScheduleMapper scheduleMapper;
   /* @Override
    public List<Schedule> selectSchedule(String doctorName,String patientName){
        return scheduleMapper.selectSchedule(doctorName,patientName);
    }*/
    @Override
    public Integer updateSchedule(Schedule schedule){
        return scheduleMapper.updateSchedule(schedule);
    }

    @Override
    public Integer insertSchedule(Schedule schedule){
        return scheduleMapper.insertSchedule(schedule);
    }
    @Override
    public  Integer deleteSchedule(List<Long> list){
        return scheduleMapper.deleteSchedule(list);
    }
    @Override
    public Integer selectCountByPatientId(Long id){
        return scheduleMapper.selectCountByPatientId(id);
    }
    @Override
    public Integer selectCountByDoctorId(Long id){
        return scheduleMapper.selectCountByDoctorId(id);
    }
    @Override
    public List<ScheduleVo> selectPatientById(Long id){
        return scheduleMapper.selectPatientById(id);
    }
    @Override
    public List<ScheduleVo> selectDoctorById(Long id){
        return scheduleMapper.selectDoctorById(id);
    }
    @Override
    public void deleteScheduleById(List<Long> list){
        scheduleMapper.deleteScheduleById(list);
    }

    @Override
    public List<ScheduleVo> selectPatientByIdWithName(Long id, String patientName) {
        List<ScheduleVo> list=scheduleMapper.selectPatientByIdWithName(id,patientName);
        return list;
    }

    @Override
    public List<ScheduleBriefVo> getScheduleByTime(LocalDateTime begin, LocalDateTime end,String deptName) {
        List<ScheduleBriefVo> list=scheduleMapper.getScheduleByTime(begin,end,deptName);
        return list;
    }

    @Override
    public ScheduleVo getInfoByScheduleId(Long id) {
        return scheduleMapper.getInfoByScheduleId(id);
    }
}
